/*! Javascript Emotifier v0.5 by Usama Ejaz | twitter.com/usamaejaz
 *  Requirements: jQuery - (1.x.x) recommended
 *  This notice MUST stay intact for legal use
 */
//<![CDATA[ 
$(document).ready(function() {
	jQuery.fn.emoticons = function(emoticon_folder) {
	var emoticon_folder = emoticon_folder || "http://usamaejaz-html-files.googlecode.com/git/emoticons/";
	var emotes ={
	    "heart": Array("&lt;3"),
	    "thumbsup": Array("\\(y\\)","\\(Y\\)"),
	    "happy": Array(":\\)\\)"),
	    "smile": Array(":-\\)",":\\)","=\\]","=\\)"),
	    "grin": Array(":D",":-D",":d",":-d"),
	    "sad": Array(":-\\(",":\\("),
	    "cool": Array("8\\)","8-\\)","B\\)","B\\|"),
	    "surprised": Array(":o",":-o",":O",":-O"),
	    "tongue": Array(":P",":-P",":p",":-p"),
	    "waii": Array("3\\)","3-\\)"),
	    "angry": Array("&gt;_&lt;"),
	    "crying": Array(":'\\("),
	    "wink": Array(";\\)",";-\\)")
	};
	var emoticonimgprefix = emoticonimgprefix || "emoticon_";
	function emoticons(html){
	    for(var emoticon in emotes){
	        for(var i = 0; i < emotes[emoticon].length; i++){
	            var re = new RegExp(emotes[emoticon][i],"g");
	            html = html.replace(re,"<img align=\"absmiddle\" src=\""+emoticon_folder+emoticonimgprefix+emoticon+".png\" alt=\""+emoticon+"\" title=\""+emoticon+"\" style=\"border:none;height:16px;width:16px;\" />");
	            }
	        }
	    return html;
	    }
	return this.each(function(){
	    $(this).html(emoticons($(this).html()));
	    });
	};
	$(displayemoticons).emoticons();
});
//]]>